#ifndef INCLUDED_XMPPTASK_H
#define INCLUDED_XMPPTASK_H

#include "task.h"
#include "XmlNode.h"

namespace tinkle {

class XmppTask : public Task {
public:
    XmppTask(BaseTask *parent);
    ~XmppTask();

    bool HasNetworkEvent() const;
    // different session should have different id
    static std::string GenSessionId();
    // NextStanza will return true if the stanza is what the task need,
    // otherwise false will be returned and the stanza will be passed to
    // next task
    // note!!! if NextStanza returns true, the task should make a copy of
    // stanza itself, because the stanza may have been deleted by the task
    // manager
    virtual bool NextStanza(XmlNode *stanza) = 0;
    void SendStanza(XmlNode *stanza);
    void SendStanza(const std::string &stanzaStr);
};

}

#endif